# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-mf2py
pkgver=2.0.1
pkgrel=0
pkgdesc="Python Microformats2 parser"
url="https://microformats.github.io/mf2py/"
arch="noarch"
license="MIT"
depends="
	py3-beautifulsoup4
	py3-html5lib
	py3-requests
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	"
checkdepends="
	py3-lxml
	py3-mock
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://github.com/microformats/mf2py/archive/v$pkgver/py3-mf2py-$pkgver.tar.gz"
builddir="$srcdir/mf2py-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
dd9d3d1d101309b8c073724d7cc57782eac2dfc0c81e65bcd8b6f6f5fba5e60e95128ecd5cbf631f6fc4f882af709c056da1706ce64b3e6f9956937923d6c6d1  py3-mf2py-2.0.1.tar.gz
"
